pluginHome = new File("./plugins").listFiles().find { it.name.startsWith('cloud-tools-')}
if(pluginHome == null) pluginHome = "."

includeTargets << new File( "${pluginHome}/scripts/CloudToolsInit.groovy" )

target('default': "Enales the BRB Page") {
	stopMysqlSlave()
}

target(stopMysqlSlave: "The implementation task") {
	depends( initCloudToolsService)
	
    cloudToolsService.withCluster {clusterManager, clusterName, cluster ->
        cluster.getClusterInstance().getDatabaseTier().stopSlave();
	    clusterManager.saveCluster(clusterName, cluster);
		event('StatusFinal', ['Slave Stopped'])
    }
}
